/*
 * @Author: shuai
 * @Date: 2023-02-15 10:03:17
 * @LastEditors: shuai
 * @LastEditTime: 2023-02-17 10:35:23
 * @Description: file content
 */
import { DefaultTheme, defineConfig } from 'vitepress'
import { componentPreview, containerPreview } from '@vitepress-demo-preview/plugin'
import { components } from '../components'
import bestPracticeCom from '../bestPractice'

const nav: DefaultTheme.NavItem[] = [
  { text: '指南', link: '/guide/' },
  { text: '组件', link: '/components/foo' }
]

const sidebar: DefaultTheme.Sidebar = {
  '/guide': [{
      text: '指南',
      items: [
        { text: '技术栈', link: '/guide/' },
        { text: '快速开始', link: '/guide/quickstart' },
      ]
    }],
  '/components': [
    {
      text: '基础组件与技术栈',
      collapsed: true,
      items: [
        {
          text: 'vue3.x手册',
          link: 'https://element-plus.gitee.io/zh-CN/'
        },
        {
          text: 'vite手册',
          link: 'https://element-plus.gitee.io/zh-CN/'
        },
        {
          text: 'typescript手册',
          link: 'https://element-plus.gitee.io/zh-CN/'
        },
        {
          text: 'ElementPlus组件',
          link: 'https://element-plus.gitee.io/zh-CN/'
        },
        {
          text: 'ant design vue',
          link: 'https://element-plus.gitee.io/zh-CN/'
        },
        {
          text: 'tailwindcss',
          link: 'https://element-plus.gitee.io/zh-CN/'
        },
        {
          text: 'three.js',
          link: 'https://element-plus.gitee.io/zh-CN/'
        },
        {
          text: 'antv/g6',
          link: 'https://element-plus.gitee.io/zh-CN/'
        },
        {
          text: 'antv/x6',
          link: 'https://element-plus.gitee.io/zh-CN/'
        },
        {
          text: 'antv/l7',
          link: 'https://element-plus.gitee.io/zh-CN/'
        },
        {
          text: 'tween.js',
          link: 'https://element-plus.gitee.io/zh-CN/'
        },
        {
          text: 'GSAP',
          link: 'https://element-plus.gitee.io/zh-CN/'
        },
    ]
    },
    {
    text: 'Tettgen组件',
    collapsed: false,
    items: [
      ...components
    ]
  }],
  '/bestPractice': [
    { 
      text: '最佳实践1', 
      collapsed: false,
      items: [
          {
            text: '内部1',
            items: [...bestPracticeCom]
          },
          {
            text: '内部2',
            items: [...bestPracticeCom]
          }
      ]
    },
    { text: '最佳实践2', items: [...bestPracticeCom]},
  ],
  '/normalizationDoc': [
    {
      text: '规范化文档',
      items: [
        { text: '项目规范', link: '/normalizationDoc/项目规范.md' },
        { text: '编码规范', link: '/normalizationDoc/编码规范.md' },
        { text: '交互规范', link: '/normalizationDoc/交互规范.md' },
        { text: '前后端通信规范', link: '/normalizationDoc/前后端通信规范.md' },
        { text: '安全规范', link: '/normalizationDoc/安全规范.md' },
      ]
    }

  ]
}

export default defineConfig({
  title: 'Tettgen前端标准化文档',
  description: '打造前端标准化，组件化开发模式',
  lang: 'cn-ZH',
  base: '/',
  lastUpdated: true,
  head: [
    [ 'link', { rel: 'icon', href: '/logo.png' } ]
  ],
  themeConfig: {
    logo: '/logo.png',
    siteTitle: 'Tettgen前端标准化文档',
    outline: 3,
    socialLinks: [
      { icon: 'github', link: 'https://github.com/vuejs/vitepress' }
    ],
    nav,
    sidebar
  },
  markdown: {
    theme: {
      light: 'vitesse-light',
      dark: 'vitesse-dark'
    },
    lineNumbers: true,
    config(md) {
      md.use(componentPreview)
      md.use(containerPreview)
    }
  }
})
